import axios from '../request'
interface Page {
  pageNumber: number;
  pageSize: number;
}
interface AddAddressParams {
  userName: string;
  userPhone: string;
  provinceName: string;
  cityName: string;
  regionName: string;
  detailAddress: string;
  defaultFlag: number;
  id?: number;
}
export function addAddress(params: AddAddressParams) {
  return axios.post('/address', params);
}

export function EditAddress(params: AddAddressParams) {
  return axios.put('/address', params);
}

export function DeleteAddress(id: number) {
  return axios.delete(`/address/${id}`);
}


export function getAddressList(pages: Page) {
  return axios.get(`/address?pageNumber=${pages.pageNumber}&pageSize=${pages.pageSize}`)
}


